package com.lijin.scheduler;

import com.lijin.service.SchedulerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时
 *
 * @author gold-jx
 */
@Component
@Slf4j
public class Scheduler {

  @Autowired
  private SchedulerService schedulerService;

  @Scheduled(initialDelay = 10000, fixedRate = 1000 * 60 * 60 * 24 * 365)
  @Async("asyncExecutor")
  public void initCode() {
    schedulerService.scheduler_fc3d("X3D");
    schedulerService.scheduler_pl3("PL3");
    schedulerService.scheduler_six("MARK_SIX");
  }

  //@Scheduled(cron = "3,6,13,16,23,26,33,36,43,46,53,56 15-35 21 * * ? ")
  //@Scheduled(cron = "7 0/1 20/23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void statusCheck() {
    //log.info("抓取福彩3D数据,开始");
    schedulerService.scheduler_fc3d("X3D");
    //log.info("抓取福彩3D数据，结束");
  }

  //@Scheduled(cron = "3,6,13,16,23,26,33,36,43,46,53,56 30-59 20 * * ? ")
  //@Scheduled(cron = "59 0/1 20/23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void pl3check() {
    //log.info("抓取排列3数据,开始");
    schedulerService.scheduler_pl3("PL3");
    //log.info("抓取排列3数据,结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ?")
  //@Scheduled(cron = "0,10,20,30,40,50 0/1 9-23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  //@Async("asyncExecutor")
  public void highbjCheck() {
    //log.info("发送抓取北京pk10数据,开始");
    schedulerService.scheduler_bjpk10("HF_BJPK10");
    //log.info("抓取北京pk10数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 10-22 * * ?")
  //@Scheduled(cron = "19,29,39,49,59 0/1 9-23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highcqCheck() {
    //log.info("发送抓取重庆时时彩数据,开始");
    schedulerService.scheduler_cqssc("HF_CQSSC");
    //log.info("抓取重庆时时彩数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 10-22 * * ? ")
  //@Scheduled(cron = "9,19,29,39,49 0/1 9-23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void hightjCheck() {
    //log.info("发送抓取天津时时彩数据,开始");
    schedulerService.scheduler_tjssc("HF_TJSSC");
    //log.info("抓取天津时时彩数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 0,1,2,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  //@Scheduled(cron = "8,18,28,38,48,58 0/1 0,1,2,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highxjCheck() {
    //log.info("发送抓取新疆时时彩数据,开始");
    schedulerService.scheduler_xjssc("HF_XJSSC");
    //log.info("抓取新疆时时彩数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 0,1,2,3,4,13,14,15,16,17,18,19,20,21,22,23 * * ? ")
  //@Scheduled(cron = "0,10,20,30,40,50 0/1 0,1,2,3,4,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highftCheck() {
    //log.info("发送幸运飞艇数据,开始");
    schedulerService.scheduler_xyft("HF_XYFT");
    //log.info("抓取幸运飞艇数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ? ")
  //@Scheduled(cron = "5,15,25,35,45,55 0/1 9-23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highgdCheck() {
    //log.info("发送广东11选5数据,开始");
    schedulerService.scheduler_gd11x5("HF_GDD11");
    //log.info("抓取广东11选5数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ?")
  //@Scheduled(cron = "17,27,37,47,57 0/1 9-23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highgdklCheck() {
    //log.info("发送广东快乐10分数据,开始");
    schedulerService.scheduler_gdklsf("HF_GDKL10F");
    //log.info("抓取广东快乐10分数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 0,1,2,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ? ")
  //@Scheduled(cron = "6,16,26,36,46,56 0/1 0,1,2,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void highcqklCheck() {
    //log.info("发送重庆快乐10分数据,开始");
    schedulerService.scheduler_cqklsf("HF_CQKL10F");
    //log.info("抓取重庆快乐10分数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 8-21 * * ?")
  //@Scheduled(cron = "2,12,22,32,42,52 0/1 8-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void ahk3Check() {
    //log.info("发送安徽快3数据,开始");
    schedulerService.scheduler_allk3("HF_AHK3");
    //log.info("抓取安徽快3数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ?")
  //@Scheduled(cron = "6,16,26,36,46,56 0/1 9-23 * * ? ")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void jx11x5Check() {
    //log.info("发送江西11选5数据,开始");
    schedulerService.scheduler_jx11x5("HF_JXD11");
    //log.info("抓取江西11选5数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ? ")
  //@Scheduled(cron = "4,14,24,34,44,54 0/1 9-23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void sh11x5Check() {
    //log.info("发送上海11选5数据,开始");
    schedulerService.scheduler_sh11x5("HF_SHD11");
    //log.info("抓取上海11选5数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-21 * * ?")
  //@Scheduled(cron = "3,13,23,33,43,53 0/1 10-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void shsslCheck() {
    //log.info("发送上海时时乐数据,开始");
    schedulerService.scheduler_shssl("HF_SHSSL");
    //log.info("抓取上海时时乐数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 8-22 * * ?")
  //@Scheduled(cron = "4,14,24,34,44,54 0/1 8-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void ah11x5Check() {
    //log.info("发送安徽11选5数据,开始");
    schedulerService.scheduler_ah11x5("HF_AHD11");
    //log.info("抓取安徽11选5数据，结束");
  }

  //@Scheduled(cron = "0,3,10,13,20,23,30,33,40,43,50,53 30-59 21 * * 2,4,6,7 " )
  //@Scheduled(cron = "9 0/1 21-22 * * 2,4,6,7")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void hk6Check() {
    //log.info("发送六合彩数据,开始");
    schedulerService.scheduler_six("MARK_SIX");
    //log.info("抓取六合彩数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 8-22 * * ?")
  //@Scheduled(cron = "5,15,25,35,45,55 0/1 8-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void sd11x5Check() {
    //log.info("发送山东11选5数据,开始");
    schedulerService.scheduler_sd11x5("HF_SDD11");
    //log.info("抓取山东11选5数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-22 * * ?")
  //@Scheduled(cron = "2,12,22,32,42,52 0/1 9-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void k3gxCheck() {
    //log.info("发送广西快3数据,开始");
    schedulerService.scheduler_allk3("HF_GXK3");
    //log.info("抓取广西快3数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 8-22 * * ?")
  //@Scheduled(cron = "3,13,23,33,43,53 0/1 8-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void k3jsCheck() {
    //log.info("发送江苏快3数据,开始");
    schedulerService.scheduler_allk3("HF_JSK3");
    //log.info("抓取江苏快3数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ?")
  //@Scheduled(cron = "1,11,21,31,41,51 0/1 9-23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void k3bjCheck() {
    //log.info("发送北京快3数据,开始");
    schedulerService.scheduler_allk3("HF_BJK3");
    //log.info("抓取北京快3数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 8-22 * * ?")
  //@Scheduled(cron = "1,11,21,31,41,51 0/1 8-22 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void k3jlCheck() {
    //log.info("发送吉林快3数据,开始");
    schedulerService.scheduler_allk3("HF_JLK3");
    //log.info("抓取吉林快3数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 9-23 * * ?")
  //@Scheduled(cron = "8,18,28,38,48,58 0/1 9-23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void bj28Check() {
    //log.info("发送北京28数据,开始");
    schedulerService.scheduler_bj28("HF_BJ28");
    //log.info("抓取北京28数据，结束");
  }

  //@Scheduled(cron = "0/6 0/1 0,1,2,3,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void cjCheck() {
    //log.info("发送财经官网数据,开始");
    schedulerService.scheduler_caijing();
    //log.info("抓取财经官网数据，结束");
  }

  //@Scheduled(cron = "0/5 0/1 0,1,2,3,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void caipiao55Check() {
    //log.info("发送彩票55官网数据,开始");
    schedulerService.scheduler_caipiao55();
    //log.info("抓取彩票55官网数据，结束");
  }

  //@Scheduled(cron = "0/7 0/1 0,1,2,3,4,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23 * * ?")
  @Scheduled(cron = " 0 0/10 * * * ?")
  @Async("asyncExecutor")
  public void caipiaoqqCheck() {
    //log.info("发送彩票qqcp官网数据,开始");
    schedulerService.scheduler_caipiaoqq();
    //log.info("抓取彩票qqcp官网数据，结束");
  }

  @Scheduled(cron = "${jobs.schedule.task}")
  public void checkData() {
    schedulerService.scheduler_checkData();
  }
}
